-
Couldn't load subscription status.
- Fork 38
[FSSDK-11136] add cmab support #514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good to me. I really like OptimizelyUserContextAndroid subclassing. It simplifies the async approach.
I made a couple of questions for clarifications.
| } | ||
|
|
||
| public Builder withCmabClient(CmabClient cmabClient) { | ||
| this.cmabClient = cmabClient; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For swift CmabClient is internal, here it is public, why this difference?
| import java.net.HttpURLConnection | ||
| import java.net.URL | ||
|
|
||
| @VisibleForTesting(otherwise = VisibleForTesting.PROTECTED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for clarification:
Why can't we use the java client here, what was the challenge?
Summary
This pull request introduces significant enhancements to the Android SDK, primarily by adding support for a new Contextual Multi-Armed Bandit (CMAB) service and improving user context handling for decision APIs. The main changes include the introduction of the
OptimizelyUserContextAndroidclass for better synchronous and asynchronous decision support, integration of CMAB service components into the SDK, and updates to the builder and manager classes to support these new features.User Context and Decision API Improvements:
OptimizelyUserContextAndroidclass, extendingOptimizelyUserContextto provide both synchronous and asynchronous decision APIs, ensuring backward compatibility and improved usability for Android clients. (android-sdk/src/main/java/com/optimizely/ab/android/sdk/OptimizelyUserContextAndroid.java)OptimizelyClientclass to returnOptimizelyUserContextAndroidinstances from allcreateUserContextmethods, with improved null checks and logging for invalid parameters. (android-sdk/src/main/java/com/optimizely/ab/android/sdk/OptimizelyClient.java)CMAB Service Integration:
OptimizelyManager, including new fields, constructor parameters, and wiring through the builder pattern. This enables configuration and use of the CMAB service within the SDK. (android-sdk/src/main/java/com/optimizely/ab/android/sdk/OptimizelyManager.java) [1] [2] [3] [4] [5] [6]android-sdk/src/main/java/com/optimizely/ab/android/sdk/OptimizelyManager.java) [1] [2]New CMAB Client Implementation:
CMABClientclass, which handles HTTP requests to the CMAB prediction endpoint, including request/response handling, error management, and exponential backoff for retries. (android-sdk/src/main/java/com/optimizely/ab/android/sdk/cmab/CMABClient.kt)Other Minor Changes:
DefaultPersistenceDelegate(appears unused and may be cleanup in a later revision). (android-sdk/src/main/java/com/optimizely/ab/android/sdk/OptimizelyManager.java)These changes collectively enhance the SDK's flexibility and robustness, especially around user context management and support for advanced decisioning features like CMAB."
Test plan
Issues